import {Toast} from '@ant-design/react-native';
type TMyToast = {
  info: (key: string) => number;
  remove: (key: number) => void;
  removeAll: () => void;
  loading: (key: string) => number;
};

const myToast: TMyToast = {
  info: function (_key: string): number {
    throw new Error('Function not implemented.');
  },
  remove: function (_key: number): void {
    throw new Error('Function not implemented.');
  },
  removeAll: function (): void {
    throw new Error('Function not implemented.');
  },
  loading: function (_key: string): number {
    throw new Error('Function not implemented.');
  },
};

myToast.info = (content: string) => {
  return Toast.info({
    content,
    duration: 1,
    mask: false,
  });
};

myToast.remove = (key: number) => {
  Toast.remove(key);
};

myToast.removeAll = () => {
  Toast.removeAll();
};

myToast.loading = (content: string) => {
  return Toast.loading({
    content,
    duration: 1,
    mask: true,
  });
};
export default myToast;
